package cn.bonoon.entities.plugins;

import java.util.Date;
import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.bonoon.kernel.support.entities.AbstractPersistable;

@MappedSuperclass
public abstract class AbstractRangeEntity extends AbstractPersistable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6532491445010060890L;

	@Column(name = "C_CREATORID")
	private Long creatorId;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_CREATEAT", nullable = false)
	private Date createAt;
	@Column(name = "C_CREATORNAME")
	private String creatorName;
	
	@Column(name = "C_OWNERID")
	private Long ownerId;
	/**
	 * 全部范围
	 */
	@Column(name = "C_ALLRANGE")
	private Boolean allRange;
	@ElementCollection
	@CollectionTable(name = "T_RANGE", joinColumns = @JoinColumn(name = "R_QUESTION_ID"))
	@Column(name = "C_RANGE")
	private List<String> range;
	
	public Long getCreatorId() {
		return creatorId;
	}
	public void setCreatorId(Long creatorId) {
		this.creatorId = creatorId;
	}
	public Date getCreateAt() {
		return createAt;
	}
	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}
	public String getCreatorName() {
		return creatorName;
	}
	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}
	public List<String> getRange() {
		return range;
	}
	public void setRange(List<String> range) {
		this.range = range;
	}
	public Boolean isAllRange() {
		return allRange;
	}
	public void setAllRange(Boolean allRange) {
		this.allRange = allRange;
	}

	public Long getOwnerId() {
		return ownerId;
	}

	public void setOwnerId(Long ownerId) {
		this.ownerId = ownerId;
	}
}
